import { InjectionKey } from 'vue';
import { Store, createStore } from 'vuex';
import { AppState } from '@/store/modules/app/state';
import { PermissionState } from '@/store/modules/permission/state';
import { UserState } from '@/store/modules/user/state';
import modules from './modules';

export interface RootState {
  app: AppState,
  permission: PermissionState,
  user: UserState,
}

export const key: InjectionKey<Store<RootState>> = Symbol('key');

export const store: Store<RootState> = createStore({
  modules,
});
